<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>${groupId}</groupId>
    <artifactId>${artifactId}</artifactId>
    <version>1.0-SNAPSHOT</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <docker.repostory>${dockerUrl}</docker.repostory>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

            <!--自定义maven插件-->
            <plugin>
                <groupId>com.demo.plugin</groupId>
                <artifactId>xy-plugin</artifactId>
                <version>1.0-SNAPSHOT</version>
                <configuration>
                    <basedir>${r'${project.basedir}'}/src</basedir>
                    <jarName>${r'${project.build.finalName}'}.jar</jarName>
                    <serverName>${r'${project.name}'}</serverName>
                    <image>${r'${project.artifactId}'}</image>
                    <modelName>${modelName}</modelName>
                    <host>${host}</host>
                    <dockerUrl>${dockerUrl}/${r'${project.artifactId}'}</dockerUrl>
                    <port>${port}</port>
                </configuration>
            </plugin>

            <!--docker插件-->
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.4.12</version>
                <!--docker镜像相关的配置信息-->
                <configuration>
                    <!--镜像名，这里用工程名-->
                    <imageName>${r'${project.artifactId}'}</imageName>
                    <dockerDirectory>src/docker</dockerDirectory>
                    <!--构建镜像的配置信息-->
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${r'${project.build.directory}'}</directory>
                            <include>${r'${project.build.finalName'}}.jar</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>